package com.eclipse.e0112_java基础.单例;

public class Teacher {
	private static Teacher t1 = new Teacher();
	private Teacher() {
	}
	public static Teacher instance() {
		return Teacher.t1;
	}
}

class Teacher1 {
	private static Teacher1 t1;
	private Teacher1() {}
	public static Teacher1 instance() {
		if (t1 == null) {
			t1 = new Teacher1();
		}
		return t1;
	}
}